home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
- <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
- <?xml-stylesheet href="chrome://mozapps/skin/extensions/about.css" type="text/css"?>
-
- <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="initPath();"
- ondialogaccept="setOptions();"
- id="linkpreviewsettings"
- title="LinkPreview">
-
-
- <script type="application/x-javascript">
- <![CDATA[
- function initPath()
- {
- const preferencesService=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
- var aWindow = document.getElementById("linkpreviewsettings");
- var prefs=aWindow.getElementsByAttribute("prefstring","*");
- if(!prefs)
- return;
- var enabl;
- var prefstring= prefs[0].getAttribute("prefstring");
- try {
- enabl=preferencesService.getBoolPref(prefstring);
- }
- catch(ex) {
- enabl=true;
- }
- if (enabl)
- prefs[0].setAttribute("checked","true");
- else
- prefs[0].setAttribute("checked","false");
-
- prefstring = prefs[1].getAttribute("prefstring");
- var context=preferencesService.getBoolPref(prefstring);
- if (context)
- prefs[1].setAttribute("checked","true");
- else
- prefs[1].setAttribute("checked","false");
-
- var searchstr=preferencesService.getCharPref("linkpreview.string");
- if (searchstr=="")
- searchstr="http://thumbnails.alexa.com/image_server.cgi?size=large&url=";
- var txtbx=document.getElementById("searchstr");
- txtbx.value=searchstr;
- }
-
- function setOptions()
- {
- const preferencesService=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
- var aWindow=document.getElementById("linkpreviewsettings");
- var prefs=aWindow.getElementsByAttribute("prefstring","*");
- if(!prefs)
- return;
- var val=prefs[0].getAttribute("checked");
- var prefstring = prefs[0].getAttribute("prefstring");
- if (val)
- preferencesService.setBoolPref(prefstring, true);
- else
- preferencesService.setBoolPref(prefstring, false);
-
- prefstring = prefs[1].getAttribute("prefstring");
- var val=prefs[1].getAttribute("checked");
- if (val)
- preferencesService.setBoolPref(prefstring,true);
- else
- preferencesService.setBoolPref(prefstring,false);
-
- var txtbx=document.getElementById("searchstr");
- var searchstr=txtbx.value;
- if (searchstr=="")
- searchstr="http://thumbnails.alexa.com/image_server.cgi?size=large&url=";
- preferencesService.setCharPref("linkpreview.string",searchstr);
- }
- function listclick(mitem)
- {
- var txtbx=document.getElementById("searchstr");
- if (mitem==0) txtbx.value="http://thumbnails.alexa.com/image_server.cgi?size=large&url=";
- else if (mitem==1) txtbx.value="http://thumbnails.alexa.com/image_server.cgi?size=small&url=";
- else if (mitem==2) txtbx.value="http://open.thumbshots.org/image.pxf?url=";
- }
- ]]>
- </script>
- <spacer style="height: 10px"/>
- <vbox style="padding-bottom:6px;background:url(chrome://linkpreview/skin/shadow.png) bottom repeat-x;">
- <vbox id="clientBox1" style="background-color:a;
- padding:6px;
- border-left:1px solid ThreeDLightShadow;
- border-top:1px solid ThreeDLightShadow;
- border-right:1px solid ThreeDLightShadow;">
- <spacer style="height: 10px"/>
- <hbox>
- <spacer style="width:10px"/>
- <hbox flex="1" style="border:1px solid ThreeDLightShadow; -moz-border-radius: 10px;background-color:ThreeDLightShadow">
- <image src="chrome://linkpreview/skin/eye32.png" width="32"/>
- <label id="extensionName" value="LinkPreview" style="padding:5px" />
- </hbox>
- <spacer style="width:10px"/>
- </hbox>
-
- <groupbox style="border:1px solid ThreeDLightShadow; -moz-border-radius: 10px" orient="vertical"><caption label="Options de l'extension"/>
- <checkbox id="idlinkpreview" label="Activer LinkPreview." prefstring="linkpreview.enabled"/>
- <checkbox id="addcontext" label="LinkPreview dans le menu contextuel." prefstring="linkpreview.addcontextmenu"/>
- </groupbox>
-
- <groupbox style="border:1px solid ThreeDLightShadow; -moz-border-radius: 10px" orient="vertical"><caption label="Serveurs"/>
- <vbox>
- <label value="Adresse:"/>
- <textbox id="searchstr" style="min-width: 400px;" prefstring="linkpreview.string"/>
- <spacer style="height: 10px"/>
- <label value="Serveur utilisé:"/>
- <menulist label="ServerList" id="ServerList" oncommand="listclick(selectedIndex)" >
- <menupopup>
- <menuitem label="Alexa's big thumbs" selected="true"/>
- <menuitem label="Alexa's small thumbs" />
- <menuitem label="Open Thumbshots" />
- </menupopup>
- </menulist>
- </vbox>
- </groupbox>
- </vbox>
- </vbox>
- </dialog>
-
-